package com.paradogs.generator.utils;

import com.paradogs.framework.core.utils.SpringUtils;
import com.paradogs.framework.core.utils.StringUtils;
import com.paradogs.generator.idl.ProtoEntitySelector;
import org.springframework.stereotype.Component;

/**
 * @author: yumi
 * @date: 2023/11/18  11:21
 * @Description: TODO
 */
public class GeneratorUtils {

    /**
     * 生成 .proto 文件
     * @param outDir .proto 文件输出路径
     * @param scanPackages 扫描包路径
     */
    public static void generatorIDL(String outDir, String[] scanPackages) {
        // 要从 Spring 中获取，才会注入 beanFactory
        ProtoEntitySelector selector = SpringUtils.getBean(ProtoEntitySelector.class);
        selector.setGeneratorDir(outDir);
        selector.setScanPackages(scanPackages);
        selector.scanAndHandle();
    }

    public static void generatorExcelData(String path) {
        if (StringUtils.isBlank(path)) {return;}

    }


}
